#!/system/bin/sh

if [ -e /data/data/dev.ukanth.ufirewall/app_bin/iptables ]; then
    path="dev.ukanth.ufirewall"
elif [ -e /data/data/dev.ukanth.ufirewall.donate/app_bin/iptables ]; then
    path="dev.ukanth.ufirewall.donate"
else
    log -p i -t afwall "AFWall doesn't seem to be installed."
    exit
fi;

defaultpath_1=/system/bin/iptables
file=/data/data/$path/app_bin/iptables

if [ -f "$file" ]; then
	if [ -f "$defaultpath_1" ]; then
		$defaultpath_1 -P INPUT DROP    
        	$defaultpath_1 -P OUTPUT DROP   
	        $defaultpath_1 -P FORWARD DROP        
	else
		$file -P INPUT DROP
		$file -P OUTPUT DROP
		$file -P FORWARD DROP
	fi;	
fi;
